﻿<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="m" uri="/cutm_tags"%>

<head>
<title><s:if test="action=='export'">编辑方案导出</s:if> <s:else>编辑方案查询</s:else></title>
<script type="text/javascript">
$(document).ready(function(){
	if('<s:property value="solutionModel.ubeginDate"/>'==null || '<s:property value="solutionModel.ubeginDate"/>'=="") {
		$("input[name='solutionModel.ubeginDate']").val("");
	}
	if('<s:property value="solutionModel.beginDate"/>'==null || '<s:property value="solutionModel.beginDate"/>'=="") {
		$("input[name='solutionModel.beginDate']").val("");
	}
	if('<s:property value="solutionModel.uendDate"/>'==null || '<s:property value="solutionModel.uendDate"/>'=="") {
		$("input[name='solutionModel.uendDate']").val("");
	}
});
</script>
</head>
<body>
<s:form id="serchForm" action="solution/SearchSolution!searchSolution" onsubmit="return true">
	<h3>方案<s:if test="action=='export'">导出</s:if><s:else>编辑</s:else>条件</h3>
	<s:hidden name="action" />
	<table id="sTable" class="form">
		<tbody>
			<tr>
				<th width="10%">方案名称</th>
				<td width="15%"><s:textfield maxlength="50" name="solutionModel.name" /></td>
				<th width="10%">方案状态</th>
				<td width="15%"><s:select name="solutionModel.status" list="#{-100:'所有方案',-1:'审核未通过',0:'未审核',1:'一审状态',2:'二审状态',3:'三审状态',4:'直接审核完成'}" listKey="key" listValue="value" ></s:select> </td>
				<th width="10%">创建时间</th>
				<td width="40%"><m:date name="solutionModel.beginDate" maxDate="0" />-<m:date name="solutionModel.endDate"
					maxDate="0" /></td>
			</tr>
			<tr>
				<th>创建人</th>
				<td><m:dropUser name="solutionModel.userId" headValue="0" headKey="--请选择--" /></td>
				<th>期号</th>
				<td><s:textfield name="solutionModel.issue" /></td>
				<th>出版日期</th>
				<td><m:date name="solutionModel.ubeginDate" />-<m:date name="solutionModel.uendDate" /></td>
			</tr>
		</tbody>
	</table>
	<div class="btnGroup"><s:submit id="search" value="查询" /></div>
</s:form>

<h2 class="title">查询列表</h2>
<table class="list">
	<thead>
		<tr>
			<th width="5%">序号</th>
			<th width="15%">方案名称</th>
			<th width="10%">期号</th>
			<th width="15%">出版日期</th>
			<th width="15%">创建时间</th>
			<th width="15%">创建人</th>
			<th width="15%">审核状态</th>
			<th width="10%">操作</th>
		</tr>
	</thead>
	<tbody>
		<s:iterator value="solutionList" status="aa">
			<tr id="pt${id }">
				<td><s:property value="#aa.index+1" /></td>
				<td><s:property value="solution.name" /></td>
				<td><s:property value="solution.issue" /></td>
				<td><s:date name="solution.date" format="yyyy-MM-dd" /></td>
				<td><s:date name="solution.recorderDate" format="yyyy-MM-dd" /></td>
				<td><s:property value="solution.recorder.name" /></td>
				<td><s:if test="solution.status==0">未审核</s:if> <s:elseif test="solution.status==1">一审完毕</s:elseif> <s:elseif
					test="solution.status==2">二审完毕</s:elseif> <s:elseif test="solution.status==3">三审完毕</s:elseif> <s:elseif
					test="solution.status==4">审核完毕</s:elseif> <s:elseif test="solution.status==-1">审核不通过</s:elseif><s:else>未知错误</s:else></td>
				<td>
				<m:imgA img="find" msg="查看详情/打印" action="solution/EditSolution!showAndPrint?solution.id=${solution.id}" />
				<s:if test="action=='detail' &&( solution.status==3 || solution.status==4)">
				</s:if> <s:if test="action=='export'">
					<m:imgA img="savecopy" msg="导出" action="solution/DownloadSolution?solutionId=${solution.id}" />
				</s:if> <s:if test="action=='modify'">
					<s:if test="solution.status==-1 || solution.status==0">
						<m:imgA img="edit" msg="修改" action="solution/EditSolution!toEdit?solution.id=${solution.id}" />
					</s:if>
					<s:if test="solution.status==1">
						<m:permiss permiss="SOLUTION_REVIEW2=SOLUTION_REVIEW3">
							<m:imgA img="edit" msg="修改" action="solution/EditSolution!toEdit?solution.id=${solution.id}" />
						</m:permiss>
					</s:if>
					<s:if test="solution.status==2">
						<m:permiss permiss="SOLUTION_REVIEW3">
							<m:imgA img="edit" msg="修改" action="solution/EditSolution!toEdit?solution.id=${solution.id}" />
						</m:permiss>
					</s:if>
				</s:if> <s:if test="action=='review'">
					<!-- 加权限验证 -->
					<m:permiss permiss="SOLUTION_REVIEW1">
						<s:if test="solution.status==0 || solution.status==-1 ">
							<m:imgA img="edit" msg="一审" action="solution/EditSolution!toReview?level=1&solution.id=${solution.id}" />
						</s:if>
					</m:permiss>
					<m:permiss permiss="SOLUTION_REVIEW2">
						<s:if test="solution.status==1">
							<m:imgA img="edit" msg="二审" action="solution/EditSolution!toReview?level=2&solution.id=${solution.id}" />
						</s:if>
					</m:permiss>
					<m:permiss permiss="SOLUTION_REVIEW3">
						<s:if test="solution.status==2">
							<m:imgA img="edit" msg="三审" action="solution/EditSolution!toReview?level=3&solution.id=${solution.id}" />
						</s:if>
					</m:permiss>
				</s:if></td>
			</tr>
		</s:iterator>
	</tbody>
</table>
</body>